jQuery.fn.extend({
    listerTreeRender: function() {
        this.each(function() {
            $(this).html(" "), new jQuery.ListerTree(this);
        });
    },
    listerTreeSelectValue: function(a) {
        var d, e, b = $(this).data("data"), c = a.split(",");
        if (b.fromList) for (d = 0; d < c.length; d++) e = -1, $.each(b.fromList, function(a, f) {
            f.id == c[d] && b.toList && (b.toList.push(b.fromList[a]), e = a);
        }), -1 != e && b.fromList.splice(e, 1);
        $(this).data("data", b), $(this).data("selectedNodes", b.toList), $(this).html(""), 
        new jQuery.ListerTree(this);
    },
    listerTreeUnSelectValue: function(a) {
        var d, e, b = $(this).data("data"), c = a.split(",");
        if (b.toList) for (d = 0; d < c.length; d++) e = -1, $.each(b.toList, function(a, f) {
            f.id == c[d] && b.fromList && (b.fromList.push(b.toList[a]), e = a);
        }), -1 != e && b.toList.splice(e, 1);
        $(this).data("data", b), $(this).data("selectedNodes", b.toList), $(this).html(""), 
        new jQuery.ListerTree(this);
    },
    listerTreeSetValue: function(a) {
        var d, e, f, b = $(this).data("data"), c = a.split(",");
        if (b.toList) {
            for (d = b.toList.length, e = 0; d > e; e++) $.each(b.toList, function(a) {
                a == e && b.fromList && b.fromList.push(b.toList[a]);
            });
            b.toList.splice(0, d);
        }
        if (b.fromList) for (e = 0; e < c.length; e++) f = -1, $.each(b.fromList, function(a, d) {
            d.id == c[e] && b.toList && (b.toList.push(b.fromList[a]), f = a);
        }), -1 != f && b.fromList.splice(f, 1);
        $(this).data("data", b), $(this).data("selectedNodes", b.toList), $(this).html(""), 
        new jQuery.ListerTree(this);
    },
    listerTreeAddItem: function(a) {
        this.each(function() {
            var b = $(this).data("data");
            b.fromList.push(a), $(this).data("data", b), $(this).data("selectedNodes", b.toList), 
            $(this).html(""), new jQuery.ListerTree(this);
        });
    },
    listerTreeRemoveItem: function(a) {
        this.each(function() {
            var b = $(this).data("data"), c = -1;
            $.each(b.fromList, function(b, d) {
                d.id.toString() == a && (c = b);
            }), -1 != c && b.fromList.splice(c, 1), $(this).data("data", b), $(this).data("selectedNodes", b.toList), 
            $(this).html(""), new jQuery.ListerTree(this);
        });
    }
});

var listerTree_id = 1;

jQuery.ListerTree = function(obj) {
    function selectedValueHandler(a, b) {
        var c, d, e, f;
        if (a) {
            if (c = b.split(","), a.toList) {
                for (d = a.toList.length, e = 0; d > e; e++) $.each(a.toList, function(b) {
                    b == e && a.fromList && a.fromList.push(a.toList[b]);
                });
                a.toList.splice(0, d);
            }
            if (a.fromList) for (e = 0; e < c.length; e++) f = -1, $.each(a.fromList, function(b, d) {
                d.id == c[e] && a.toList && (a.toList.push(a.fromList[b]), f = b);
            }), -1 != f && a.fromList.splice(f, 1);
            return a;
        }
    }
    function initSetting() {
        fromSetting = {
            view: {
                addHoverDom: addHoverDom,
                removeHoverDom: removeHoverDom,
                selectedMulti: !1
            },
            data: {
                simpleData: {
                    enable: !0
                }
            }
        }, toSetting = {
            view: {
                addHoverDom: addHoverDom2,
                removeHoverDom: removeHoverDom2,
                selectedMulti: !1
            },
            data: {
                simpleData: {
                    enable: !0
                }
            },
            callback: {
                beforeRename: beforeRename,
                onRename: onRename
            }
        };
    }
    function initTreeData(a) {
        a && (a.fromList && $.fn.zTree.init(leftCon, fromSetting, a.fromList), a.toList && $.fn.zTree.init(rightCon, toSetting, a.toList), 
        $(obj).attr("relValue", getValue()), $hidden.val(getValue()));
    }
    function createOptions(a) {
        a && (initSetting(), initTreeData(a));
    }
    function createOptions2(a, b, c) {
        asyncSetting = {
            async: {
                enable: !0,
                dataType: "JSON",
                dataName: dataRoot,
                url: a,
                autoParam: b,
                otherParam: c
            },
            view: {
                addHoverDom: addHoverDom,
                removeHoverDom: removeHoverDom,
                selectedMulti: !1
            },
            data: {
                simpleData: {
                    enable: !0
                }
            }
        }, toSetting = {
            view: {
                addHoverDom: addHoverDom2,
                removeHoverDom: removeHoverDom2,
                selectedMulti: !1
            },
            data: {
                simpleData: {
                    enable: !0
                }
            },
            callback: {
                beforeRename: beforeRename,
                onRename: onRename
            }
        }, $.fn.zTree.init(leftCon, asyncSetting), $.fn.zTree.init(rightCon, toSetting, ""), 
        $(obj).attr("relValue", getValue()), $hidden.val(getValue());
    }
    function setupHidden() {
        var a = $('<input type="hidden">');
        return null != $(obj).attr("name") && a.attr("name", $(obj).attr("name")), a;
    }
    function beforeRename(a, b, c) {
        return 0 == c.length ? (top.Dialog.alert("节点名称不能为空."), !1) : !0;
    }
    function onRename() {
        $(obj).trigger("itemClick");
    }
    function addHoverDom(a, b) {
        var d, e, f, c = $("#" + b.tId + "_span");
        if (!($(obj).find("#addBtn_" + b.id).length > 0)) if ("true" == $(obj).attr("customGroup") || 1 == $(obj).attr("customGroup")) if ("true" == b.selectAll || 1 == b.selectAll) d = "<span class='listerTreeArrowRightAll' id='addBtn_" + b.id + "' title='" + uncompile(quiLanguage.listerTree.selectBtnText) + "' onfocus='this.blur();'></span>", 
        c.append(d), e = $(obj).find("#addBtn_" + b.id), e && e.bind("click", function() {
            var e, f, g, a = $.fn.zTree.getZTreeObj(leftCon.attr("id")), c = $.fn.zTree.getZTreeObj(rightCon.attr("id")), d = c.getSelectedNodes();
            if (0 == d.length) return top.Dialog.alert("请先选中右侧的编组节点"), void 0;
            if (!(null != d[0].group && 0 != d[0].group && "false" != d[0].group || null != d[0].root && 0 != d[0].root && "false" != d[0].root)) return top.Dialog.alert("不能选择右侧的人员节点来添加"), 
            void 0;
            for (e = a.getNodesByParam("parentId", b.id), f = 0; f < e.length; f++) e[f].oldParentId && 0 != e[f].drag && "false" != e.drag && 0 != e[f].selectable && "false" != e.selectable && (g = a.getNodeByParam("id", e[f].id), 
            a.removeNode(g), c.addNodes(d[0], e[f]));
            $(obj).trigger("itemClick");
        }); else {
            if ("false" == b.selectable || 0 == b.selectable || null == b.oldParentId || "null" == b.oldParentId || "false" == b.drag || 0 == b.drag) return;
            f = "<span class='listerTreeArrowRight' id='addBtn_" + b.id + "' title='" + uncompile(quiLanguage.listerTree.selectBtnText) + "' onfocus='this.blur();'></span>", 
            c.append(f), e = $("#addBtn_" + b.id), e && e.bind("click", function() {
                var f, g, a = $.fn.zTree.getZTreeObj(leftCon.attr("id")), d = $.fn.zTree.getZTreeObj(rightCon.attr("id")), e = d.getSelectedNodes();
                return 0 == e.length ? (top.Dialog.alert("请选择右侧的编组节点"), void 0) : null != e[0].group && 0 != e[0].group && "false" != e[0].group || null != e[0].root && 0 != e[0].root && "false" != e[0].root ? (a.removeNode(b), 
                d.addNodes(e[0], {
                    id: b.id,
                    parentId: b.parentId,
                    name: b.name,
                    drop: !1,
                    icon: b.icon,
                    oldParentId: b.oldParentId
                }), $(obj).trigger("itemClick"), f = $('<div class="itemMinEffect"></div>'), g = 25 + 15 * c.text().length, 
                f.css({
                    width: g,
                    height: 15,
                    left: currentMouseX - g + "px",
                    top: currentMouseY - 5 + "px",
                    opacity: .1
                }).animate({
                    width: 0,
                    height: 0,
                    left: currentMouseX + 500 + "px",
                    top: currentMouseY - 5 + "px",
                    opacity: 0
                }, 400, function() {
                    f.remove();
                }), $("body").append(f), !1) : (top.Dialog.alert("不能选择右侧的人员节点"), void 0);
            });
        } else if ("true" == b.selectAll || 1 == b.selectAll) d = "<span class='listerTreeArrowRightAll' id='addBtn_" + b.id + "' title='" + uncompile(quiLanguage.listerTree.selectBtnText) + "' onfocus='this.blur();'></span>", 
        c.append(d), e = $(obj).find("#addBtn_" + b.id), e && e.bind("click", function() {
            var e, f, g, a = $.fn.zTree.getZTreeObj(leftCon.attr("id")), c = $.fn.zTree.getZTreeObj(rightCon.attr("id")), d = a.getNodesByParam("parentId", b.id);
            for (e = 0; e < d.length; e++) d[e].oldParentId && 0 != d[e].drag && "false" != d.drag && 0 != d[e].selectable && "false" != d.selectable && (f = a.getNodeByParam("id", d[e].id), 
            a.removeNode(f), "true" == $(obj).attr("keepGroup") ? (g = c.getNodeByParam("id", f.oldParentId, null), 
            g || (c.addNodes(null, {
                id: b.id,
                parentId: b.parentId,
                name: b.name,
                drop: !1,
                drag: !1,
                icon: b.icon,
                oldParentId: b.oldParentId,
                selectAll: !0
            }), g = c.getNodeByParam("id", b.id, null)), c.addNodes(g, d[e])) : c.addNodes(null, d[e]));
            $(obj).attr("relValue", getValue()), $hidden.val(getValue()), $(obj).trigger("itemClick");
        }); else {
            if ("false" == b.selectable || 0 == b.selectable || null == b.oldParentId || "null" == b.oldParentId || "false" == b.drag || 0 == b.drag) return;
            f = "<span class='listerTreeArrowRight' id='addBtn_" + b.id + "' title='" + uncompile(quiLanguage.listerTree.selectBtnText) + "' onfocus='this.blur();'></span>", 
            c.append(f), e = $("#addBtn_" + b.id), e && e.bind("click", function() {
                var e, f, g, h, a = $.fn.zTree.getZTreeObj(leftCon.attr("id")), d = $.fn.zTree.getZTreeObj(rightCon.attr("id"));
                return a.removeNode(b), "true" == $(obj).attr("keepGroup") ? (e = d.getNodeByParam("id", b.oldParentId, null), 
                e || (f = a.getNodeByParam("id", b.oldParentId, null), d.addNodes(null, {
                    id: f.id,
                    parentId: f.parentId,
                    name: f.name,
                    drop: !1,
                    drag: !1,
                    icon: f.icon,
                    oldParentId: f.oldParentId
                }), e = d.getNodeByParam("id", f.id, null)), d.addNodes(e, {
                    id: b.id,
                    parentId: b.parentId,
                    name: b.name,
                    drop: !1,
                    icon: b.icon,
                    oldParentId: b.oldParentId
                })) : d.addNodes(null, {
                    id: b.id,
                    parentId: b.parentId,
                    name: b.name,
                    drop: !1,
                    icon: b.icon,
                    oldParentId: b.oldParentId
                }), $(obj).attr("relValue", getValue()), $hidden.val(getValue()), $(obj).trigger("itemClick"), 
                g = $('<div class="itemMinEffect"></div>'), h = 25 + 15 * c.text().length, g.css({
                    width: h,
                    height: 15,
                    left: currentMouseX - h + "px",
                    top: currentMouseY - 5 + "px",
                    opacity: .1
                }).animate({
                    width: 0,
                    height: 0,
                    left: currentMouseX + 500 + "px",
                    top: currentMouseY - 5 + "px",
                    opacity: 0
                }, 400, function() {
                    g.remove();
                }), $("body").append(g), !1;
            });
        }
    }
    function removeHoverDom(a, b) {
        $("#addBtn_" + b.id).unbind().remove();
    }
    function addHoverDom2(a, b) {
        var d, e, f, g, h, i, j, k, c = $("#" + b.tId + "_span");
        if ("true" == $(obj).attr("customGroup") || 1 == $(obj).attr("customGroup")) if ("true" == b.group || 1 == b.group || "true" == b.root || 1 == b.root) {
            if ($(obj).find("#addBtn_" + b.id).length > 0 || $(obj).find("#editBtn_" + b.id).length > 0) return;
            d = "<span class='zbutton add' id='addBtn_" + b.id + "' title='新建子编组' onfocus='this.blur();'></span>", 
            c.append(d), e = "<span class='zbutton edit' id='editBtn_" + b.id + "' title='修改编组名称' onfocus='this.blur();'></span>", 
            c.append(e), f = "<span class='zbutton remove' id='removeBtn_" + b.id + "' title='移除编组' onfocus='this.blur();'></span>", 
            "true" == b.root || 1 == b.root || c.append(f), g = $(obj).find("#addBtn_" + b.id), 
            g && g.bind("click", function() {
                var a = $.fn.zTree.getZTreeObj(rightCon.attr("id")), c = a.addNodes(b, {
                    id: 100 + newCount,
                    parentId: b.id,
                    name: "分组" + newCount++,
                    icon: prePath + "libs/icons/user_group.gif",
                    group: !0
                });
                return c && a.editName(c[0]), !1;
            }), h = $(obj).find("#editBtn_" + b.id), h && h.bind("click", function() {
                var a = $.fn.zTree.getZTreeObj(rightCon.attr("id"));
                return a.editName(b), !1;
            }), i = $(obj).find("#removeBtn_" + b.id), i && i.bind("click", function() {
                var a = $.fn.zTree.getZTreeObj(rightCon.attr("id"));
                return setTimeout(function() {
                    var c = $.fn.zTree.getZTreeObj(leftCon.attr("id")), d = a.getNodesByParam("parentId", b.id);
                    d.length > 0 ? top.Dialog.confirm("该组下还有子节点，移除后子节点会还原到左侧。确定移除吗？", function() {
                        var e, f;
                        for (e = 0; e < d.length; e++) d[e].oldParentId && (f = c.getNodeByParam("id", d[e].oldParentId, null), 
                        c.addNodes(f, d[e]));
                        a.removeNode(b), $(obj).trigger("itemClick");
                    }) : (a.removeNode(b), $(obj).trigger("itemClick"));
                }, 100), !1;
            });
        } else {
            if ($(obj).find("#removeBtn_" + b.id).length > 0) return;
            if ("false" == b.selectable || 0 == b.selectable || null == b.oldParentId || "null" == b.oldParentId || "false" == b.drag || 0 == b.drag) return;
            j = "<span class='zbutton remove' id='removeBtn_" + b.id + "' title='" + uncompile(quiLanguage.listerTree.deSelectBtnText) + "' onfocus='this.blur();'></span>", 
            c.append(j), k = $(obj).find("#removeBtn_" + b.id), k && k.bind("click", function() {
                var a = $.fn.zTree.getZTreeObj(rightCon.attr("id"));
                return a.selectNode(b), setTimeout(function() {
                    var c, d, e, f, g;
                    "true" == $(obj).attr("keepGroup") ? b.getNextNode() || b.getPreNode() ? a.removeNode(b) : (c = b.getParentNode(), 
                    a.removeNode(b), a.removeNode(c)) : a.removeNode(b), d = $.fn.zTree.getZTreeObj(leftCon.attr("id")), 
                    e = d.getNodeByParam("id", b.oldParentId), e ? d.addNodes(e, {
                        id: b.id,
                        parentId: e.id,
                        name: b.name,
                        drop: !1,
                        icon: b.icon,
                        oldParentId: b.oldParentId
                    }) : d.addNodes(null, {
                        id: b.id,
                        parentId: b.oldParentId,
                        name: b.name,
                        drop: !1,
                        icon: b.icon,
                        oldParentId: b.oldParentId
                    }), $(obj).trigger("itemClick"), f = $('<div class="itemMinEffect"></div>'), g = 25 + 15 * b.name.length, 
                    f.css({
                        width: g,
                        height: 15,
                        left: currentMouseX - g + "px",
                        top: currentMouseY - 5 + "px",
                        opacity: .1
                    }).animate({
                        width: 0,
                        height: 0,
                        left: currentMouseX - 500 + "px",
                        top: currentMouseY - 5 + "px",
                        opacity: 0
                    }, 400, function() {
                        f.remove();
                    }), $("body").append(f);
                }, 100), !1;
            });
        } else {
            if ($(obj).find("#removeBtn_" + b.id).length > 0) return;
            if ("true" == b.selectAll || 1 == b.selectAll) j = "<span class='zbutton remove' id='removeBtn_" + b.id + "' title='" + uncompile(quiLanguage.listerTree.deSelectBtnText) + "' onfocus='this.blur();'></span>", 
            c.append(j), k = $(obj).find("#removeBtn_" + b.id), k && k.bind("click", function() {
                var a = $.fn.zTree.getZTreeObj(rightCon.attr("id"));
                setTimeout(function() {
                    var e, f, c = $.fn.zTree.getZTreeObj(leftCon.attr("id")), d = a.getNodesByParam("parentId", b.id);
                    for (e = 0; e < d.length; e++) d[e].oldParentId && (f = c.getNodeByParam("id", d[e].oldParentId, null), 
                    c.addNodes(f, d[e]));
                    a.removeNode(b), $(obj).attr("relValue", getValue()), $hidden.val(getValue());
                }, 100);
            }); else {
                if ("false" == b.selectable || 0 == b.selectable || null == b.oldParentId || "null" == b.oldParentId || "false" == b.drag || 0 == b.drag) return;
                j = "<span class='zbutton remove' id='removeBtn_" + b.id + "' title='" + uncompile(quiLanguage.listerTree.deSelectBtnText) + "' onfocus='this.blur();'></span>", 
                c.append(j), k = $("#removeBtn_" + b.id), k && k.bind("click", function() {
                    var a = $.fn.zTree.getZTreeObj(rightCon.attr("id"));
                    return a.selectNode(b), setTimeout(function() {
                        var c, d, e, f, g;
                        "true" == $(obj).attr("keepGroup") ? b.getNextNode() || b.getPreNode() ? a.removeNode(b) : (c = b.getParentNode(), 
                        a.removeNode(b), a.removeNode(c)) : a.removeNode(b), d = $.fn.zTree.getZTreeObj(leftCon.attr("id")), 
                        e = d.getNodeByParam("id", b.oldParentId), e ? d.addNodes(e, {
                            id: b.id,
                            parentId: e.id,
                            name: b.name,
                            drop: !1,
                            icon: b.icon,
                            oldParentId: b.oldParentId
                        }) : d.addNodes(null, {
                            id: b.id,
                            parentId: b.oldParentId,
                            name: b.name,
                            drop: !1,
                            icon: b.icon,
                            oldParentId: b.oldParentId
                        }), $(obj).attr("relValue", getValue()), $hidden.val(getValue()), $(obj).trigger("itemClick"), 
                        f = $('<div class="itemMinEffect"></div>'), g = 25 + 15 * b.name.length, f.css({
                            width: g,
                            height: 15,
                            left: currentMouseX - g + "px",
                            top: currentMouseY - 5 + "px",
                            opacity: .1
                        }).animate({
                            width: 0,
                            height: 0,
                            left: currentMouseX - 500 + "px",
                            top: currentMouseY - 5 + "px",
                            opacity: 0
                        }, 400, function() {
                            f.remove();
                        }), $("body").append(f);
                    }, 100), !1;
                });
            }
        }
    }
    function removeHoverDom2(a, b) {
        $("#removeBtn_" + b.id).unbind().remove(), $("#addBtn_" + b.id).unbind().remove(), 
        $("#editBtn_" + b.id).unbind().remove();
    }
    function selectAll() {
        var a, b, c, d, e, f;
        if (dataObj) {
            for ($.fn.zTree.init(leftCon, fromSetting, dataObj.fromList), $.fn.zTree.init(rightCon, toSetting, dataObj.toList), 
            a = $.fn.zTree.getZTreeObj(leftCon.attr("id")), b = $.fn.zTree.getZTreeObj(rightCon.attr("id")), 
            c = 0; c < dataObj.fromList.length; c++) dataObj.fromList[c].oldParentId && 0 != dataObj.fromList[c].drag && "false" != dataObj.fromList[c].drag && (d = a.getNodeByParam("id", dataObj.fromList[c].id), 
            a.removeNode(d), "true" == $(obj).attr("keepGroup") ? (e = b.getNodeByParam("id", d.oldParentId, null), 
            e || (f = a.getNodeByParam("id", d.oldParentId, null), b.addNodes(null, {
                id: f.id,
                parentId: f.parentId,
                name: f.name,
                drop: !1,
                drag: !1,
                icon: f.icon,
                oldParentId: f.oldParentId,
                selectAll: !0
            }), e = b.getNodeByParam("id", f.id, null)), b.addNodes(e, dataObj.fromList[c])) : b.addNodes(null, dataObj.fromList[c]));
            $(obj).attr("relValue", getValue()), $hidden.val(getValue()), $(obj).trigger("itemClick");
        }
    }
    function cancelAll() {
        dataObj && (initTreeData(selectedValueHandler(dataObj, "")), $(obj).trigger("itemClick"));
    }
    function getValue() {
        var b, c, d, e, a = $.fn.zTree.getZTreeObj(rightCon.attr("id"));
        if (a) {
            for (b = "true" == $(obj).attr("keepGroup") ? a.transformToArray(a.getNodes()) : a.getNodes(), 
            $(obj).data("selectedNodes", b), c = "", d = "", e = 0; e < b.length; e++) c += "," + b[e].id, 
            d += "," + b[e].name;
            return c.length > 0 && (c = c.substring(1)), d.length > 0 && (d = d.substring(1)), 
            $(obj).attr("relText", d), c;
        }
    }
    var $hidden, enabled, outerDiv, leftCon, rightCon, $fromTitle, $toTitle, listDivA, listDivB, btnCon, btn1, btn2, $table, dataRoot, selectedValue, paramsStr, paramsObj, dataObj, urlStr, dataStr, dataObj2, autoParamStr, autoParam, dataType, fromSetting, toSetting, asyncSetting, newCount;
    if (listerTree_id++, $hidden = setupHidden(), enabled = !0, null != $(obj).attr("disabled") && (enabled = "false" == $(obj).attr("disabled") || 0 == $(obj).attr("disabled") ? !0 : !1), 
    outerDiv = $(obj), leftCon = $('<ul class="ztree dbSelectionMode"></ul>'), rightCon = $('<ul class="ztree dbSelectionMode"></ul>'), 
    leftCon.attr("id", "listerTree" + listerTree_id + "_from"), rightCon.attr("id", "listerTree" + listerTree_id + "_to"), 
    $(obj).attr("listerHeight") ? (leftCon.height(Number($(obj).attr("listerHeight"))), 
    rightCon.height(Number($(obj).attr("listerHeight")))) : (leftCon.height(200), rightCon.height(200)), 
    $fromTitle = $("<div></div>"), $toTitle = $("<div></div>"), null != $(obj).attr("fromTitle") ? $fromTitle.html($(obj).attr("fromTitle")) : $fromTitle.html(uncompile(quiLanguage.listerTree.fromTitle)), 
    null != $(obj).attr("toTitle") ? $toTitle.html($(obj).attr("toTitle")) : $toTitle.html(uncompile(quiLanguage.listerTree.toTitle)), 
    listDivA = $("<div></div>").append($fromTitle).append(leftCon), listDivB = $("<div></div>").append($toTitle).append(rightCon), 
    $(obj).attr("listerWidth") ? (listDivA.width(Number($(obj).attr("listerWidth"))), 
    listDivB.width(Number($(obj).attr("listerWidth")))) : (listDivA.width(200), listDivB.width(200)), 
    btnCon = $('<div class="listBtn"></div>'), btn1 = $('<input type="button" value="' + uncompile(quiLanguage.listerTree.selectAllBtnText) + '" class="button"/>'), 
    btn1.bind("click", function() {
        selectAll();
    }), btnCon.append(btn1), btnCon.append("<br/><br/>"), btn2 = $('<input type="button" value="' + uncompile(quiLanguage.listerTree.deSelectAllBtnText) + '" class="button">'), 
    btn2.bind("click", function() {
        cancelAll();
    }), btnCon.append(btn2), (1 == $(obj).attr("asyncMode") || "true" == $(obj).attr("asyncMode")) && (btn1.hide(), 
    btn2.hide()), (1 == $(obj).attr("customGroup") || "true" == $(obj).attr("customGroup")) && (btn1.hide(), 
    btn2.hide()), $table = $('<table cellspacing="0" cellpadding="0" style="border-style:none;"><tr><td class="ali01" style="border-style:none;padding:0;margin:0;"></td><td class="ali02" style="border-style:none;padding-left:5px;padding-right:5px;margin:0;"></td><td class="ali01" style="border-style:none;padding:0;margin:0;"></td></tr></table>'), 
    $table.find("td").eq(0).append(listDivA), $table.find("td").eq(1).append(btnCon), 
    $table.find("td").eq(2).append(listDivB), $(outerDiv).append($table), $(outerDiv).width($table.width()), 
    0 == enabled && (btn1.attr("disabled", "true"), btn2.attr("disabled", "true"), $(outerDiv).mask(uncompile(quiLanguage.listerTree.disabledMessage), 0, !1, "#ffffff")), 
    btn1.buttonInputRender(), btn2.buttonInputRender(), $(outerDiv).append($hidden), 
    dataRoot = "treeNodes", $(obj).attr("dataRoot") && (dataRoot = $(obj).attr("dataRoot")), 
    selectedValue = "-1", null != $(obj).attr("selectedValue") && (selectedValue = $(obj).attr("selectedValue")), 
    paramsStr = $(obj).attr("params")) try {
        paramsObj = JSON.parse(paramsStr);
    } catch (e) {
        paramsObj = [], alert(uncompile(quiLanguage.listerTree.paramErrorMessage));
    } else paramsObj = [];
    if (dataObj = "", urlStr = $(obj).attr("url"), dataStr = $(obj).attr("data"), dataObj2 = $(obj).data("data"), 
    "true" == $(obj).attr("asyncMode") || 1 == $(obj).attr("asyncMode")) {
        if (autoParamStr = $(obj).attr("autoParam")) try {
            autoParam = JSON.parse(autoParamStr);
        } catch (e) {
            autoParam = [], alert(uncompile(quiLanguage.listerTree.paramErrorMessage));
        } else autoParam = [ "id", "name" ];
        createOptions2(urlStr, autoParam, paramsObj);
    } else if (dataObj2) dataObj = dataObj2, "-1" == selectedValue ? createOptions(dataObj2) : createOptions(selectedValueHandler(dataObj2, selectedValue)); else if (dataStr) {
        try {
            dataObj = JSON.parse(dataStr);
        } catch (e) {
            dataObj = "", alert(uncompile(quiLanguage.listerTree.dataErrorMessage));
        }
        "-1" == selectedValue ? createOptions(dataObj) : createOptions(selectedValueHandler(dataObj, selectedValue)), 
        $(obj).data("data", dataObj);
    } else urlStr && (dataType = "json", $(obj).attr("dataType") && (dataType = $(obj).attr("dataType")), 
    $.ajax({
        url: $(obj).attr("url"),
        dataType: dataType,
        data: paramsObj,
        error: function() {
            alert(uncompile(quiLanguage.listerTree.urlErrorMessage));
        },
        success: function(data) {
            var myData;
            myData = "text" == dataType ? eval("(" + data + ")") : data, dataObj = myData, $(obj).data("data", myData), 
            $(obj).data("selectedNodes", myData.toList), "-1" == selectedValue ? createOptions(myData) : createOptions(selectedValueHandler(myData, selectedValue));
        }
    }));
    return newCount = 1, this;
};